#include <cstdio>

int sum[ 1000001 ];
bool visit[ 1001 ];

int main( )
{
    int n, i, j, ret, t;
    for ( i = 1; i <= 500000; i++ )
    {
        for ( j = 2 * i; j <= 1000000; j += i )
            sum[ j ] += i;
    }
    for ( i = 1; i <= 1000000; i++ )
        if ( sum[ i ] <= 1000 )
            visit[ sum[ i ] ] = true;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        if ( visit[ n ] )
            puts("no");
        else
            puts("yes");
    }
    return 0;
}
